<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title th:text="'VD系统登录'">VD系统登录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 本地 Bootstrap 样式 -->
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <style>
        body {
            background-color: #f5f5f5;
        }
        .login-container {
            max-width: 400px;
            margin: 80px auto;
            padding: 30px;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .login-container h2 {
            margin-bottom: 20px;
            text-align: center;
        }
    </style>
</head>
<body>
<div class="login-container">
    <h2>VD系统登录</h2>
    <form method="post" action="/login">
        <div class="mb-3">
            <label for="username" class="form-label">用户名</label>
            <input type="text" class="form-control" id="username" name="username" required autofocus>
        </div>
        <div class="mb-3">
            <label for="password" class="form-label">密码</label>
            <input type="password" class="form-control" id="password" name="password" required>
        </div>
        <!-- Spring Security 默认需要 CSRF -->
        <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
        <div class="d-grid gap-2">
            <button type="submit" class="btn btn-primary">登录</button>
        </div>
    </form>
    <!-- 如果需要，还可以显示错误信息 -->
    <div th:if="${param.error}" class="alert alert-danger mt-3">用户名或密码错误</div>
    <div th:if="${param.logout}" class="alert alert-success mt-3">您已成功退出</div>
</div>
</body>
</html>
